Option Public
Option Declare

Uselsx "*javacon"

'/**
' * JAVA类名
' */
Private Const JAVA_CLASS_NAME	= "JAVACLASS"


'/**
' * LotusScript调用Java类
' * @depends JavaSession
' * @error 
' */
Public Class cLS2JSample
	
	Private m_jSession	As JavaSession
	Private m_jClass	As JavaClass
	Private m_jObject	As JavaObject
	
	'/**
	' * 构造函数
	' * 
	' * @depends
	' * @see
	' * @error
	' * @version 1.0
	' * @author
	' */
	Public Sub New
try:
		'set up error handler
		On Error Goto catch
		
		Set m_jSession	= New JavaSession
		Set m_jClass	= m_jSession.GetClass(JAVA_CLASS_NAME)
		Set m_jObject	= m_jClass.CreateObject()
		
		Goto finally
catch:
		'log error
		Msgbox Erl & ":" & Error
		'resume to the final thing
		Resume finally
		
finally:
		'do the final thing
		
	End Sub
	
	'/**
	' * 结构函数
	' * 
	' * @depends
	' * @see
	' * @error
	' * @version 1.0
	' * @author
	' */
	Public Sub Delete
try:
		'set up error handler
		On Error Goto catch
		
		If Not m_jObject Is Nothing Then
			Call m_jObject.close()	'if you need to call a specific destructor on the Java side, call it here
		End If
		
		Goto finally
catch:
		'log error
		Msgbox Erl & ":" & Error
		'resume to the final thing
		Resume finally
		
finally:
		'do the final thing
		
	End Sub
	
End Class